﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CalendarParser
{
    public static class CommonUtility
    {
        static string easternZoneName = "Eastern Standard Time";

        public static DateTime ConvertESTtoLocalTime(DateTime EST)
        {
            TimeZoneInfo estZone = TimeZoneInfo.FindSystemTimeZoneById(easternZoneName);
            return TimeZoneInfo.ConvertTime(EST, estZone, TimeZoneInfo.Local);
        }

        public static DateTime ConvertLocaltoESTTime(DateTime local)
        {
            TimeZoneInfo estZone = TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id);
            return TimeZoneInfo.ConvertTime(local, TimeZoneInfo.Local, estZone);
        }
    }
}
